#!/usr/bin/env bash
LLVM_VER=7.0
if [ -n $1 ];then
    LLVM_VER=$1
fi
if [ ! -d /usr/lib/llvm-$LLVM_VER/lib/cmake/clang ];then
    ln -s /usr/share/llvm-$LLVM_VER/cmake /usr/lib/llvm-$LLVM_VER/lib/cmake/clang
fi
if [ ! -f /usr/lib/llvm-$LLVM_VER/bin/clang-$LLVM_VER ];then
    cp /usr/lib/llvm-$LLVM_VER/bin/clang /usr/lib/llvm-$LLVM_VER/bin/clang-$LLVM_VER
    cp /usr/lib/llvm-$LLVM_VER/bin/clang++ /usr/lib/llvm-$LLVM_VER/bin/clang++-$LLVM_VER
fi
cmake . -DCMAKE_BUILD_TYPE=Release
